/**************************************************************************************
 *
 * @(#) MybatisPlusConfig.java
 * @Package com.jgdt.jgdtkasannong_university_gene_backend.config.mybatisplus
 **************************************************************************************/
package com.jgdt.jgdtkasannong_university_gene_backend.config.mybatisplus;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
 * @description: mybatisPlus 分页插件配置
 * @author: huangAn
 * @createDate: 2025/04/18
 */
@Configuration
@MapperScan("com.jgdt.jgdtkasannong_university_gene_backend.mapper")
public class MybatisPlusConfig {

    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        // 添加分页插件
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }
}



